package test.vo;

import java.io.Serializable;

public class Student implements Serializable, Comparable<Student> {
	private int stdNum;
	private String stdName;
	private int age;

	public Student(int stdNum, String stdName, int age) {
		super();
		this.stdNum = stdNum;
		this.stdName = stdName;
		this.age = age;
	}

	public int getStdNum() {
		return stdNum;
	}

	public void setStdNum(int stdNum) {
		this.stdNum = stdNum;
	}

	public String getStdName() {
		return stdName;
	}

	public void setStdName(String stdName) {
		this.stdName = stdName;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public Student(String stdName) {
		super();
		this.stdName = stdName;
	}

	@Override
	public int compareTo(Student o) {
		return stdNum - o.stdNum;
	}

	@Override
	public boolean equals(Object obj) {
		if (obj instanceof Student){
			return stdName.equals(((Student)obj).stdName);
		} else {
			return false;
		}
	}

}
